package org.example.domain;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;

import javax.persistence.Id;
import javax.persistence.Table;

@Data
@Table(name = "t_product") //只要类的命名符合驼峰命名法，即此注解可省略
public class TProduct {
    //使用tkmapper时，实体类中，必须要指定哪个是你的主键
    @Id
    private Long id;
    private String name;
    private String resources;
    private Double saleprice;
    //理由：后台在返回数据给前端时，因为要将集合对象，转为json格式
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private java.util.Date offsaletime;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private java.util.Date onsaletime;
    private Long state;
    private String costprice;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private java.util.Date createtime;
    private Long salecount;

}
